package com.heima.mapper;

import com.github.pagehelper.Page;
import com.heima.pojo.dto.CommodityPageQueryDTO;
import com.heima.pojo.Commodity;
import com.heima.pojo.dto.CommodityDTO;
import com.heima.pojo.vo.CommodityVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CommodityMapper {
@Insert("insert into tb_sku_class(class_name)values (#{className})")
    void insert(CommodityDTO dto);


    Page<Commodity> pagingQuery(CommodityPageQueryDTO dto);
@Select("select * from tb_sku_class where class_id =#{classId}")
    CommodityVO getId(Integer id);

//@Update("update tb_sku_class set class_name = #{className} where class_id =#{classId}")
    void update(String className,Integer classId);
@Delete("delete from tb_sku_class where class_id = #{classId}")
    void deleteId(Integer classId);
}
